//
//  Step3InputField.m
//  Gunz
//
//  Created by Joggy on 16/4/16.
//  Copyright © 2016年 NUPT. All rights reserved.
//

#import "Step3InputField.h"
#import "GZConst.h"

@implementation Step3InputField

-(instancetype)initWithTitle:(NSString*)title {
    self = [super initWithFrame:CGRectMake(0, 0, [GZConst getScreenWidth], 36)];
    UILabel *titleLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 110*proportion, 17)];
    CGPoint tem = titleLab.layer.position;
    tem.y = self.frame.size.height/2;
    titleLab.layer.position = tem;
    titleLab.textColor = TEXT_TITLE_COLOR;
    titleLab.font = [UIFont systemFontOfSize:14];
    titleLab.textAlignment = NSTextAlignmentRight;
    titleLab.text = title;
    [self addSubview:titleLab];
    _textField = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 150*proportion, self.frame.size.height)];
    _textField.layer.position = CGPointMake(195*proportion, self.frame.size.height/2);
    NSString *plac = @"输入框";
    _textField.placeholder = plac;
    _textField.layer.borderWidth = 1;
    _textField.layer.borderColor = TEXT_BORDER_COLOR.CGColor;
    _textField.backgroundColor = [UIColor whiteColor];
    _textField.layer.cornerRadius = 6;
    _textField.leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, 36)];
    _textField.leftViewMode = UITextFieldViewModeAlways;
    [self addSubview:_textField];
    return self;
}

@end
